<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<!-- 在命令行中输入app.isActive = false -->
		<h2 :class="{active:isActive,line:isLine}">{{message}}</h2>		
		<!-- 写法太长的话,就用方法返回 -->
		<h2 :class="getClasses()">{{message}}</h2>		
		<button type="button" v-on:click="btnClick">点击</button>
	</body>
	<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		const app = new Vue({
			el: "#app",
			data: {
				message : "你好",
				active: "active",
				isActive : true,
				isLine : true
			},
			methods:{
				btnClick: function(){
					this.isActive = !this.isActive
				},
				getClasses: function(){
					return {active: this.isActive,line: this.isLine}
				}
			}
		})
	</script>
</html>
